package com.seveneight.baijiesteward.ui.user.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.CardBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.user.contract.CardListContract;
import com.seveneight.baijiesteward.ui.user.model.CardListModel;

import java.util.List;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/23.
 */

public class CardListPresenter implements CardListContract.CardListPresenter {

    CardListContract.CardListView cardListView;
    CardListContract.CardListModel cardListModel;

    public CardListPresenter(CardListContract.CardListView cardListView) {
        this.cardListView = cardListView;
        cardListModel=new CardListModel();

    }

    @Override
    public void getCardList(Context context, RequestBody body) {
        cardListModel.getCardList(context,body, new MyCallBack<List<CardBean>>() {
            @Override
            public void onSuccess(List<CardBean> cardBeans) {
                cardListView.reBackCardList(cardBeans);
            }

            @Override
            public void onFailed() {

            }
        });
    }

}
